<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$ci = &get_instance();
	$USER = getAccountUserObject();
	$ESCORT = $ci->escort_entity->init('user_id',$USER->getId());
	$LOCKED = $ci->locked_escort_entity->init('escort_id', $ESCORT->getId());
	
	/**
	if($LOCKED->getLockedLanguageIds() != 1){
		$language_array = array_filter( explode(',',$ci->input->post('lang_ids',TRUE)) );
	}else{
		$language_array = array_filter( explode(',',$ESCORT->getLanguageIds()) );
	}	
	**/
	$language_array = array_filter( explode(',',getLanguagesSiteString_ioc()) );
	$languageOptionArray = getLanguagesSite_ioc();
?>

<?php echo loader_image_s('id="personal_languages_loader" class="hidden"');?>
<div id="description-tabs">
	<?php if(!empty($language_array)):?>
		<ul>
			<?php foreach($language_array as $item):?>
				<li><a href="#des-tabs-lang-<?php echo $item;?>"><?php echo $languageOptionArray[$item][0];?></a></li>
			<?php endforeach; ?>
			<li class="ui-tabs-last-non-selected"><a href="#des-tabs-lang-00">&nbsp;</a></li>
		</ul>
		<?php foreach($language_array as $item):?>
			<div id="des-tabs-lang-<?php echo $item;?>">
				<textarea rows="10" cols="58" name="personal_info_language_<?php echo $item;?>" class="descClsTextarea" id="<?php echo $item;?>"><?php echo $ESCORT->getDescription($item,$ESCORT->getId());?></textarea>
				
				<div class="clear" style="height:5px;"></div>
				<div class="trans_language_mode" style="font-size:12px;">
					<input type="checkbox" onoff="1" value="1" name="trans_mode_<?php echo $item;?>" id="trans_mode_id_<?php echo $item;?>" class="custom autotranslate" <?php echo $ESCORT->getTranslateMode($item,$ESCORT->getId()) == 1 ? "checked='checked'":''; ?> />
					&nbsp;&nbsp;&nbsp;	
					<?php echo language_translate('personal_info_translate_mode_label');?>	
				</div>
				
				<div class="clear" style="height:5px;"></div>
				<div class="source_language_mode" style="font-size:12px;">
					<input type="checkbox" onoff="1" value="1" name="lang_source_<?php echo $item;?>" id="lang_source_<?php echo $item;?>" class="custom sourcelanguage" />
					&nbsp;&nbsp;&nbsp;	
					<?php echo language_translate('personal_info_source_label');?>	
				</div>
			</div>
		<?php endforeach; ?>
		
		<input type="hidden" id="isChangeDescFlag" name="isChangeDescFlag" value="0" />
	<?php endif; ?>
</div>

<?php //exit; ?>
<div class="help-text" title="<?php echo language_translate('personal_info_desc_hint');?>"></div>	